Return a string array

Does their exist anyway to return an array of type string from a function.I actually want this

{
string[] splitstring (string str,char chArray[])
{
string strArray[50]
//function defined here
return strArray
}
}

The above function takes a string and an array of characters (used as separator like "," , " " , ";")and split the string on the basis of separators in character array and put each word on a string array strArray[]. All is going fine except the return of strArray from the function.

I know I may do it using

Array splitstring(string str,char chArray[])

But I want to use 1-dimensional(linear) array as I have explained above.
MF2G_qaus_qazah - Fri Apr 27 00:28:06 EDT 2012

Re: Return a string array
SystemAdmin - Fri Apr 27 02:51:42 EDT 2012

Look here to see the syntax to return a string array. There is nothing wrong with the syntax. The problem arises if you define local storage and reference the storage after the function that defined it ends.

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14777803&#14777803